/*
设计开发一个高校社团管理系统
社团：
变量：名称，负责人，服务范围，社团人数信息，社团成员，
方法：展示活动
学生：
变量：姓名，学号，密码
方法：参加社团（可以参加多个社团），查看所有社团，
申请社团，退出社团，
社团负责人：
变量：姓名，学号，密码
方法：组织活动，查看社团人员，查看社团情况，审批申请
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<queue>
#include<algorithm>
#include<vector>
using namespace std;
class Student{
public:
    Student(){}
    Student(string a,string b,string c,string d):stuName(a),stuPassword(b),stuAsso(c),stuNumber(d){}
    string stuName,stuPassword,stuAsso,stuNumber;
};
class Association{
public:
    Association(string a,string b,string c):assoName(a),assoLeader(b),assoAct(c),assoNumber(0){}
    void setAssoName(string a){
        assoName=a;
    }
    void setAssoLeader(string a){
        assoLeader=a;
    }
    void setAssoAct(string a){
        assoAct=a;
    }
    void addMemmber(Student &a){
        member.push_back(a);
        assoNumber++;
    }
    string getAssoName(){
        return assoName;
    }
    string getAssoLeader(){
        return assoLeader;
    }
    string getAssoAct(){
        return assoAct;
    }
    int getAssoNumber(){
        return assoNumber;
    }
private:
    string assoName,assoLeader,assoAct;
    int assoNumber;
    vector<Student>member;
};
class AssoLeader:public Student{
public:
    AssoLeader(){}
    AssoLeader(string a,string b,string c,string d):Student(a,b,c,d){}
    /*
    AssoLeader(AssoLeader &a){
        this->stuName=a.stuName;
        this->stuPassword=a.stuPassword;
        this->stuAsso=a.stuAsso;
        this->stuNumber=a.stuNumber;
    }*/
private: 
};
vector<Association> assList;
vector<Student> stuList;
vector<AssoLeader> lderList;
void creat(){
   Association a1("古典文学社","千反田爱瑠","研究古典书籍，解决一些日常小问题，有出版期刊《冰菓》");
   AssoLeader l1("千反田爱瑠","zmftl","古典文学社","050101");
   Student s1("折木奉太郎","qdtal","古典文学社","050104");
   Student s2("伊原摩耶花","fblz","古典文学社","050105");
   a1.addMemmber(s1);
   a1.addMemmber(s2);
   a1.addMemmber(l1);
   lderList.push_back(l1);
   assList.push_back(a1);
   stuList.push_back(s1);
   stuList.push_back(s2);
   Association a2("侍奉部","雪之下雪乃","可以提出委托，帮助同学解决问题");
   AssoLeader l2("雪之下雪乃","bqgbp","侍奉部","050102");
   Student s3("比企谷八幡","xzxxn","侍奉部","050106");
   Student s4("由比滨结衣","bqgbp","侍奉部","050107");
   a2.addMemmber(s3);
   a2.addMemmber(s4);
   a2.addMemmber(l2);
   lderList.push_back(l2);
   assList.push_back(a2);
   stuList.push_back(s3);
   stuList.push_back(s4);
   Association a3("邻人部","三日月夜空","以交友为宗旨的社团，没朋友的人快来加入吧！");
   AssoLeader l3("三日月夜空","ylcxy","邻人部","050103");
   Student s5("羽濑川小鹰","sryyk","邻人部","050108");
   Student s6("柏崎星奈","ylcxy","邻人部","050109");
   a3.addMemmber(s5);
   a3.addMemmber(s6);
   a3.addMemmber(l3);
   lderList.push_back(l3);
   assList.push_back(a3);
   stuList.push_back(s5);
   stuList.push_back(s6);
}
string sign(){
    string userName,password;
    int choose;
    printf("请输入登录方式！\n1.社团负责人\n2.学生\n");
    cin>>choose;
    printf("请输入用户名：\n");
    cin>>userName;
    if(choose==1){
        int flag=0;
        AssoLeader nl;
        for(int i=0;i<3;i++){
            if(lderList[i].stuNumber==userName){
                nl=lderList[i];
                flag++;
                break;
            }
        }
        if(flag==0){
            cout<<"用户名错误！"<<endl;
        }
        else{
            printf("请输入密码：\n");
            cin>>password;
            if(password==nl.stuPassword){
                cout<<"登录成功！"<<endl;
            }
            else{
                cout<<"登录失败！"<<endl;
            }
        }
    }else if(choose==2){
        int flag=0;
        Student nl;
        for(int i=0;i<3;i++){
            if(lderList[i].stuNumber==userName){
                nl=lderList[i];
                flag++;
                break;
            }
        }
        if(flag==0){
            cout<<"用户名错误！"<<endl;
        }
        else{
            printf("请输入密码：\n");
            cin>>password;
            if(password==nl.stuPassword){
                cout<<"登录成功！"<<endl;
            }
            else{
                cout<<"登录失败！"<<endl;
            }
        }
    }
}
int main(){
    creat();
    /*
    for(int i=0;i<assList.size();i++){
        cout<<"社团："<<assList[i].getAssoName()<<endl;
        cout<<"社团负责人："<<assList[i].getAssoLeader()<<endl;
        cout<<"社团服务："<<assList[i].getAssoAct()<<endl;
        cout<<endl;
    }
    cout<<endl;
    */
    sign();
    return 0;
}